<%@ page session="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<jsp:include page="../cabecera_home.jsp"></jsp:include>


<style type="text/css">
div.panel,p.flip {
	margin: 0px;
	padding: 5px;
	text-align: center;
	background: #e5eecc;
	border: solid 1px #c3c3c3;
}

div.panel {
	height: 120px;
	display: none;
}
</style>
<script src="static/scripts/jquery.js"></script>
<script>
	$(document).ready(function() {
		$(".flip").click(function() {
			$(".panel").slideToggle("slow");
		});
	});
</script>
<div class="marquesina_index" align="center">

	<br> <br> <br>

	<h1>Detalle Stock</h1>


	<form:form modelAttribute="stock" action="#" method="post">

		<table>
			<tr>
				<td valign="top"><form:input type="hidden" path="id" />
					<table>
						<tr bgcolor=#FFFFFA>
							<td align="left">Variedad:</td>
							<td align="left">${stock.variedad}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Color:</td>
							<td align="left">${stock.color}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Acidez:</td>
							<td align="left">${stock.acidez}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Alcohol:</td>
							<td align="left">${stock.alcohol}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Azucar:</td>
							<td align="left">${stock.azucar}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Edad:</td>
							<td align="left">${stock.edad}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Cantidad:</td>
							<td align="left">${stock.cantidad} L.</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Precio:</td>
							<td align="left">$ ${stock.precio}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Registro INV:</td>
							<td align="left">#${stock.idINV}</td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Creado:</td>
							<td align="left"><fmt:formatDate
									value="${stock.fechaCreacionStock}" pattern="MM/dd/yyyy"
									timeZone="GMT" /></td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Vencimiento:</td>
							<td align="left"><fmt:formatDate
									value="${stock.vencimiento}" pattern="MM/dd/yyyy"
									timeZone="GMT" /></td>
						</tr>
						<tr bgcolor=#FFFFFA>
							<td align="left">Estado:</td>
							<c:choose>
								<c:when test='${stock.fechaVenta != null}'>
									<td align="left"><span style="color: red;">Vendido
											el <fmt:formatDate value="${stock.fechaVenta}"
												pattern="MM/dd/yyyy" timeZone="GMT" />
									</span></td>

								</c:when>
								<c:otherwise>
									<td align="left"><span style="color: green;">Disponible</span></td>
								</c:otherwise>
							</c:choose>
						</tr>
						<tr>
							<td></td>
							<td><a href="stocks_modificar?id=${stock.id}"> <input
									type="button" value="Modificar"></a> <a
								href="javascript:history.back()"> <input type="button"
									value="Volver"></a></td>
						</tr>
					</table></td>

			</tr>
		</table>

	</form:form>

	<div class="panel">
		<table>
			<tr>
				<td><img class="foto_contacto"
					src="static/images/maipo-u1343.png" alt="imgen_perfil" width="90"
					height="90" /></td>
				<td>
					<table>
						<tr>
							<td><b>Razon Social: </b></td>
							<td>${contacto.razonSocial}</td>
						</tr>
						<tr>
							<td><b>Correo electronico:</b></td>
							<td>${contacto.correoElectronico}</td>
						</tr>
						<tr>
							<td><b>Telefono:</b></td>
							<td>${contacto.telefono}</td>
						</tr>
						<tr>
							<td><b>Sitio Web:</b></td>
							<td><a href="http://${contacto.sitioWeb}" target="_blank">${contacto.sitioWeb}</a></td>
						</tr>

					</table>
				</td>

			</tr>
		</table>
	</div>

	<p class="flip">
		<strong>Mostrar/Ocultar Datos Contacto</strong>
	</p>


</div>

<jsp:include page="../pie_de_pagina_compartida.jsp"></jsp:include>